↳ Prolog
↳ PrologToPiTRSProof
balance_in(T, TB) → U1(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1(T, TB, balance_out(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out(T, TB)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
balance_in(T, TB) → U1(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1(T, TB, balance_out(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out(T, TB)
BALANCE_IN(T, TB) → U11(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN(T, TB) → BALANCE_IN(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U31(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in(T, TB) → U1(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1(T, TB, balance_out(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out(T, TB)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
BALANCE_IN(T, TB) → U11(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
BALANCE_IN(T, TB) → BALANCE_IN(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U31(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in(T, TB) → U1(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1(T, TB, balance_out(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out(T, TB)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in(T, TB) → U1(T, TB, balance_in(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, [])))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
U1(T, TB, balance_out(T, -(I, []), -(.(','(TB, -(I, [])), X), X), -(Rest, []), -(Rest, []))) → balance_out(T, TB)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → BALANCE_IN(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))
BALANCE_IN(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
U21(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → BALANCE_IN(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))
balance_in(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT)) → U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1)))
balance_in(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T)) → balance_out(nil, -(X, X), -(A, B), -(A, B), -(.(','(nil, -(C, C)), T), T))
U2(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(L, -(IH, .(V, IT1)), -(H, T), -(HR1, TR1), -(NH, NT1))) → U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_in(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT)))
U3(L, V, R, IH, IT, LB, VB, RB, A, D, H, X, T, HR, TR, NH, NT, balance_out(R, -(IT1, IT), -(HR1, TR1), -(HR, TR), -(NT1, NT))) → balance_out(tree(L, V, R), -(IH, IT), -(.(','(tree(LB, VB, RB), -(A, D)), H), .(','(LB, -(A, .(VB, X))), .(','(RB, -(X, D)), T))), -(HR, TR), -(NH, NT))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
BALANCE_IN(tree(L, V, R)) → BALANCE_IN(L)
BALANCE_IN(tree(L, V, R)) → U21(R, balance_in(L))
U21(R, balance_out) → BALANCE_IN(R)
balance_in(tree(L, V, R)) → U2(R, balance_in(L))
balance_in(nil) → balance_out
U2(R, balance_out) → U3(balance_in(R))
U3(balance_out) → balance_out
balance_in(x0)
U2(x0, x1)
U3(x0)
From the DPs we obtained the following set of size-change graphs: